#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int minOperations(vector<int>& nums) {
        int cnt = 0, n = nums.size();
        for (int i = 0; i < n; i++)
        {
            if ((cnt + nums[i]) % 2 == 0)
            {
                ++cnt;
            }
        }
        return cnt;
    }
};